package com.artnology.independence.model.relationships;

import java.awt.BasicStroke;
import java.awt.Stroke;

import com.artnology.independence.Activator;
import com.artnology.independence.model.DVGraphModel;
import com.artnology.independence.model.DVType;
import com.artnology.independence.views.DependencyView;

public class DVImplementsRelationship extends DVAbstractTypeRelationship {

	private static final Stroke implementsStroke = new BasicStroke(1.0f,
			BasicStroke.CAP_BUTT, BasicStroke.JOIN_MITER, 10.0f,
			new float[] { 2.0f }, 5.0f);
	private static final Stroke thickerImplementsStroke = new BasicStroke(3.0f,
			BasicStroke.CAP_BUTT, BasicStroke.JOIN_MITER, 10.0f,
			new float[] { 2.0f }, 5.0f);

	public DVImplementsRelationship(DVGraphModel model, DVType referencedNode, DVType referenceFromType) {
		super(null, model, referencedNode, referenceFromType);
	}

	@Override
	public Stroke getStroke() {
		if (Activator.getDefault().getPrefStore().getBoolean(DependencyView.INDICATE_CROSS_PACKAGE_EDGE) && this.crossesPackageBorder()) {
			return thickerImplementsStroke;
		}
		return implementsStroke;
	}

	@Override
	public String getPrefix() {
		return "implements";
	}



}
